import os
import json
import leancloud
import datetime
import re
leancloud.init("FuEKBAKt7fr6CnVTfMVXKyMm-gzGzoHsz", "9Gw1lGPn1fgxJ3gKw04BltIU")
area = leancloud.Object.extend("Area")
area_data = leancloud.Object.extend("AreaData")
raw_data = leancloud.Object.extend("RawData")
'''query = area_data.query
query.limit(1000)
query.contained_in("area_name", ["大理", "红河", "德宏", "楚雄", "文山", "凉山"])
l = query.find()
save_list = list()
print(query.count())
for i in l:
    print(i.get("area_name"))
    name = i.get("area_name")
    name += "州"
    i.set("area_name", name)
    save_list.append(i)
    print(name)
area_data.save_all(save_list)
'''
query = area.query
query.limit(1000)
query.contained_in("name", ["大理", "红河", "德宏", "楚雄", "文山", "凉山"])
l = query.find()
print(query.count())
for i in l:
    print(i.get("name"))
area.destroy_all(l)